import type {AppRouteModule} from '@/router/types';

// 遍历所有路由文件
const modules = require.context('./modules', true, /\.ts$/)

const routeModuleList: AppRouteModule[] = [];

// 加载到路由
modules.keys().forEach((key) => {
    const mod = modules(key).default || {}
    const modList = Array.isArray(mod) ? [...mod] : [mod];
    routeModuleList.push(...modList);
  }
)

// Basic routing without permission
export const basicRoutes = [
  ...routeModuleList
];
